/*
 * @Author: JohnYang
 * @Date: 2020-09-23 12:49:17
 * @LastEditors: JohnYang
 * @LastEditTime: 2020-09-28 23:11:13
 */
import http from "@/utils/request";
import { userType } from "@/config";

export function getEmployeeList({
  pageSize,
  pageNum,
  userName,
  telephone,
  account,
  start,
  end
}) {
  return http({
    url: "/index/index/list",
    method: "POST",
    data: {
      type: userType,
      pageSize: pageSize,
      offset: pageNum,
      telephone,
      userName,
      account,
      start,
      end
    }
  });
}

export function delEmployee(employeeId) {
  return http({
    url: "/index/index/delete",
    method: "POST",
    data: {
      type: userType,
      id: employeeId
    }
  });
}

export function createEmployee(EmployeeModel) {
  return http({
    url: "/index/index/save",
    method: "POST",
    data: {
      ...EmployeeModel,
      type: userType
    }
  });
}

export function updateEmployee(EmployeeModel) {
  return http({
    url: "/index/index/save",
    method: "POST",
    data: {
      ...EmployeeModel,
      type: userType
    }
  });
}
